<?php
include '../../comm/config.php';
$appKey = TAOAPPKEY;
$appSecret = TAOAPPSECRET;
$top_parameters=$_GET['top_parameters'];
$top_sign=$_GET['top_sign'];

if(base64_encode(md5($top_parameters.$appSecret,true))!=$top_sign){
	exit('签名错误！');
} 

if($top_parameters!=''){
    $top_parameters_de=base64_decode($top_parameters);
    //$top_parameters_de=iconv("GB2312","UTF-8",$top_parameters_de);
    parse_str($top_parameters_de,$b);
    $nick_taobao=$b['nick'];
    $sql="select dduserid,ortheruserid from ".$BIAOTOU."apilogin where ortherusername='".$nick_taobao."' and ortherwebname='淘宝' limit 1";
	$query=mysql_query($sql);
	$row=mysql_fetch_array($query);
	if($row['dduserid']>0){
	    $taobao_user_id=$row['ortheruserid'];
	}
	else{
	    $taobao_user_id=abs((crc32($dbpass.$nick_taobao)));
	}
	
	$param=array('action'=>"http://".URL."/user/register_api.php",'orther_web_id'=>$taobao_user_id,'orther_web_name'=>$nick_taobao,'orther_web'=>'淘宝');
    echo form($param);
}
?>